Repository navigation
feat(spec,plugin-audit): an activity milestone's timeline row reads in the reader's language - #37582
objectstack-fleet[bot] wants to merge 6 commits into
Conversation
Claude-Session: https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj Co-authored-by: Claude <noreply@anthropic.com>
…check Claude-Session: https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj Co-authored-by: Claude <noreply@anthropic.com>
…r, reference docs Claude-Session: https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj Co-authored-by: Claude <noreply@anthropic.com>
…r pins to their own file Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj
📓 Docs Drift CheckThis PR changes 3 package(s): 1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
What this run could not see
Coarse fallback — 180 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin bdb51e38990bbad0b9e66ea8dbcfad020d63abbb && git checkout bdb51e38990bbad0b9e66ea8dbcfad020d63abbb
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 6c290d3af7c52d019d1de1c09b6b0306f09700bb 578a08d188abbe34f068395203243db11371a8a5 && git checkout -B drift-repro 6c290d3af7c52d019d1de1c09b6b0306f09700bb && git merge --no-ff 578a08d188abbe34f068395203243db11371a8a5
node scripts/docs-audit/affected-docs.mjs --json 6c290d3af7c52d019d1de1c09b6b0306f09700bb
|
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj
|
Generated by Claude Code |
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA Re-run once · 2026-11-26T14:48Z · head 578a08d · run 45837008571 One red on this head: Test Core (5/10), job 139970139703, in The cause is named, and it is not this PR's. The So the failed jobs are re-run once through the relay. A second red on this PR would be read as real. |
Requested by Sales · project thread
Fixes #37524
Clause-②: yes (widening)
Metadata-protocol: added
Skills-docs: follow-up #37585
维护者速读
skills/objectstack-i18n补一句的后续卡是 skills: objectstack-i18n lists the object translation sub-keys but not_milestones.<field>.<value>.summaryonce PR #37582 lands #37585。What changes
The reading (at
4116465625): the timeline already serves most rows in the reader's language — the CRUD mirror stores a summary CODE beside the sentence and thesys_activityread middleware re-composes it per reader (packages/plugins/plugin-audit/src/activity-summary-message.ts). A fired milestone was the one row left out, by an implementation note in that file ("its template is the author's sentence and is never translated"), andObjectTranslationDataSchemahad no key the template could be translated under. ADR-0052 §5b.2 defines the milestone and says nothing about its language.packages/spec/src/system/translation.zod.ts). An object translation accepts_milestones: { <field>: { <value>: { summary } } }. A milestone declares no name; the watchedfieldand thevalueit fires on are what fire it (the writer fires the first declared match), so the pair is its address and no new authorable key is added toactivityMilestones.milestones/activityMilestonesalias the group, asvalidationsaliases_validations.packages/spec/src/system/i18n-resolver.ts).resolveObjectMilestoneSummary(bundle, object, field, value, opts)reads the template along the locale chain; a dotted value is one key. It is deliberately NOT overlaid bytranslateObject: an object served by/metawith the translated template on it would round-trip into the authored declaration on the next Studio save. A pin holds thattranslateObjectleavesactivityMilestones[].summaryas authored.packages/plugins/plugin-audit/src/audit-writers.ts). A fired milestone's row now carriesmetadata.summary_message={ key: 'activityMilestone', object, field, value, tokens }, each token stored as the field-change code stores a value: the text the writer rendered, plus the select option it matched. The storedsummaryis unchanged (the authored sentence, rendered as before), and so aretype,metadata.kindand the text sources the redaction reads.activity-summary-message.ts).readerSummaryLocalegainsmilestoneSummary, which reads the template from the same bundle andResolveOptionsthe labels are translated with.composeActivitySummaryinterpolates it: a select token is named by the option label on the reader-language object definition, any other token by its stored text, and a token with no stored value (a token the translation adds, or an empty value) renders empty, as an empty value does in the authored sentence. No template for the reader's language ⇒ nothing is composed and the stored sentence stands. A tenant that reworded a packaged milestone'ssummarykeeps its words (ADR-0029 D9.2a, judged as a reworded validation message is: the served milestone against the packaged one of the same pair). The code is stripped frommetadatafor every non-system reader, as the other non-field-change codes are.summarydropped before this middleware runs; the middleware only overlays asummarystill present, so it never re-adds a dropped one. Pinned below.i18n-walk.ts) scaffoldsobjects.<o>._milestones.<field>.<value>.summaryfor each pair, the first entry of a repeated pair only. The translation-reference rule (validate-translation-references.ts) flags a_milestoneskey over a pair no milestone of the object declares, suggesting the near value.examples/app-showcasetranslates its one milestone (showcase_task,status→done) in zh-CN, so the extractor's new key is translated where the coverage gate measures it.content/docs/ui/translations.mdx(the key table) andcontent/docs/protocol/kernel/i18n-standard.mdx(the reference rule's table) name the key.content/docs/references/system/translation.mdx,api-surface/system.json,export-origins/system.jsonand the strictness-ledger count (system/409 → 410, the new strict object) regenerated bycheck:generated --fix.Small calls made here (no card): the
field+valueaddress rather than a newnameon a milestone; a boolean token keeps rendering its stored value (as the authored sentence does today) rather than a per-locale yes/no word; token texts are not length-bounded in the code (the authored sentence they come from is not bounded either).Why
An app that is otherwise fully translated still wrote authoring-language rows ("Case escalated — …") on the record timeline, with no key it could fill in.
Verification
packages/plugins/plugin-audit/src/activity-milestone-summary-locale.integration.test.ts(new; real kernel, real audit writer, SQLite, the engine middleware chain): a zh-CN reader reads商机赢单:Acme(赢单)from the zh-CN template with the{stage}token named by its zh-CN option label; the system, an en reader, a read with no locale and a ja-JP reader (no entry) read the storedDeal won: Acme (Won); the code is stored for the system and served to no other caller; a reader not served a token's field (note) gets the row with nosummary. Red first: with the composer's template lookup stubbed out, the zh-CN pin and the redaction pin's served half fail (2 of 4).activity-summary-message.test.ts, new describe: composes the translated template, an unstored token empty; nothing composed for a locale with no entry or on a locale with nomilestoneSummary; a tenant's rewording of the packaged milestone keeps its words while the untouched one translates; the stored code reads back and a malformed one is refused.packages/spec/src/system/i18n-milestone-summary.test.ts(new): the key is read by pair, a dotted value as one key, along the fallback chain,undefinedon misses; the schema accepts the group and refuses a key it does not declare;translateObjectleaves the authored summary.packages/lint/src/i18n-milestones-37524.test.ts(new): the extractor emits one key per fired pair seeded with the authored template; the reference rule resolves declared pairs and flags an undeclared value (with the suggestion) and an unwatched field.validate-translation-references.test.ts: the lint:validate-translation-referenceshas no_tabsleg — an authored key naming a filter-preset tab that does not exist warns nobody #13835 object-branch coverage ledger classifies_milestonesas reference-checked, backed by a ghost that reports, and the all-groups control bundle names the real pair.92e8e1bcf:@objectstack/plugin-auditvitest 110 files / 1,840 tests pass;@objectstack/lintvitest 237 files / 9,683 tests pass (the one red, the coverage ledger, fixed in the tip commit and re-run: 268/268);@objectstack/specvitestsrc/systempass;node scripts/check-i18n-bundles.mjsexit 0; eslint on the touched files exit 0;tsc --noEmitfor plugin-audit exit 0;pnpm --filter @objectstack/spec check:generatedexit 0;node scripts/pm/overlap-check.mjsexit 0.check:i18n-coverageneeds the built examples and is left to CI.Contract review (L2) is owed before landing: the diff changes
packages/spec/src/**and declaresClause-②: yes (widening).Human Minimum
packages/specholds no runtime logic.pnpm lintpasses.main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj
Generated by Claude Code